package org.sky.sys.controller;

import org.sky.sys.api.ISysOrganClientRemoteApi;
import org.sky.sys.entity.SysOrgan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value="/organ")
public class SysOrganController {
    @Autowired
    private ISysOrganClientRemoteApi sysOrganClientRemoteApi;
    /**
    private static final String URL_PREFIX="http://MICROSERVICECLOUD-DEPT/";
    @Autowired
    private RestTemplate restTemplate;
     **/
    @GetMapping(value = "/getSysOrgan/{code}")
    public SysOrgan getSysOrganByCode(@PathVariable String code){
        System.out.println("getSysOrganByCode123 invoke "+code);
        return sysOrganClientRemoteApi.getSysOrganByCode123(code);
    }
}
